@function px($n) {
  @return calc($n * 100vw / 1920);
}

@mixin hoverBtn {
  cursor: pointer;
  user-select: none;

  &:active {
    opacity: 0.8;
  }

  &:hover {
    opacity: 0.9;
  }
}

@mixin button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #4766d4;
  color: #ffffff;
  border-radius: 2px;
  font-size: 16px;
  font-weight: 400;
  font-family: "Microsoft YaHei";
  @include hoverBtn;
}

@mixin flex-x-center {
  display: flex;
  justify-content: center;
}

@mixin flex-y-center {
  display: flex;
  align-items: center;
}

@mixin flex-x-y-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@mixin flex-x-between-y-center {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@mixin base-btn {
  width: fit-content;
  height: 32px;
  border-radius: 2px;
  padding: 0 16px;
  @include flex-x-y-center;
  @include hoverBtn;
  font-size: 14px;

  i {
    font-size: 16px;
    margin-right: 8px;
  }
}

.btn-bg {
  @include base-btn();
  background-color: #4766d4;
  color: #fff;
}

.btn-bg-reset {
  @include base-btn();
  background: rgba(242, 243, 245, 1);
  color: #4b5b76;
}

.btn-bg-del {
  @include base-btn();
  background: rgba(255, 236, 232, 1);
  color: #fa5050;
}

.btn-border {
  @include base-btn();
  border: 1px solid #4766d4;
  color: #4766d4;
}
